using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DBSetupHelper
{
    /// <summary>
    /// 
    /// </summary>
    public partial class SettingsDialog : Form
    {
        private bool extractOnly;
        private bool cancelInstall;
        /// <summary>
        /// Initializes a new instance of the <see cref="SettingsDialog"/> class.
        /// </summary>
        public SettingsDialog()
        {
            InitializeComponent();
        }

        private void btnRun_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            cancelInstall = true;
            this.DialogResult = DialogResult.Cancel;
        }

        private void btnExtractOnly_Click(object sender, EventArgs e)
        {
            extractOnly = true;
            this.DialogResult = DialogResult.OK;
        }

        /// <summary>
        /// Gets or sets the server.
        /// </summary>
        /// <value>The server.</value>
        public string Server
        {
            get { return txtServer.Text; }
            set { txtServer.Text = value; }
        }

        /// <summary>
        /// Gets or sets the name of the user.
        /// </summary>
        /// <value>The name of the user.</value>
        public string UserName
        {
            get { return txtUserName.Text; }
            set { txtUserName.Text = value; }
        }

        /// <summary>
        /// Gets or sets the password.
        /// </summary>
        /// <value>The password.</value>
        public string Password
        {
            get { return txtPassword.Text; }
            set { txtPassword.Text = value; }
        }

        /// <summary>
        /// Gets or sets a value indicating whether [extract only].
        /// </summary>
        /// <value><c>true</c> if [extract only]; otherwise, <c>false</c>.</value>
        public bool ExtractOnly
        {
            get { return this.extractOnly; }            
        }

        public bool CancelInstall
        {
            get { return this.cancelInstall; }
        }        
    }
}